#include "InteractionCommandPage.h"
#include "CommandDispatcher.h"


void InteractionCommandPage::paint() {
    resetStream();
    strStream <<std::setw(13) << "commandRespon" << std::setw(3) << pageNum;
    std::string interactionInfo = strStream.str();
    std::string& lastCommandResponse = CommandDispatcherSingleton::instance().mlastCommandResponse;
    if (!lastCommandResponse.empty()){
        interactionInfo.append(lastCommandResponse);
    } else {
        interactionInfo.append("no command and response yet!");
    }
    interactionInfo.resize(Screen::SCREEN_WIDTH * Screen::SCREEN_HEIGHT, ' ');
    screen.showFast(0, 0, Screen::SCREEN_WIDTH, Screen::SCREEN_HEIGHT, interactionInfo);
}


